﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace CommunitySystem.Elements
{
    public partial class GridSpliteTo : UserControl
    {
        public event EventHandler ToLeft;
        public event EventHandler ToRight;

        public GridSpliteTo()
        {
            InitializeComponent();
        }

        private void toLeft_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (ToLeft != null)
            {
                ToLeft(this, EventArgs.Empty);
            }
        }

        private void toRight_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (ToRight != null)
            {
                ToRight(this, EventArgs.Empty);
            }
        }

        private void Border_MouseEnter(object sender, MouseEventArgs e)
        {
            toRight.Fill = new SolidColorBrush(Colors.Black);
        }

        private void Border_MouseLeave(object sender, MouseEventArgs e)
        {
            toRight.Fill = new SolidColorBrush(Colors.White);
        }

        private void Left_MouseEnter(object sender, MouseEventArgs e)
        {
            toLeft.Fill = new SolidColorBrush(Colors.Black);
        }

        private void Left_MouseLeave(object sender, MouseEventArgs e)
        {
            toLeft.Fill = new SolidColorBrush(Colors.White);
        }
    }
}
